package com.atguigu.gmall.item.contoller;
import com.atguigu.gmall.item.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@RequestMapping("api/item")
public class ItemContoller {
    @Autowired
    ItemService itemService;

    @GetMapping("/{skuId}")
    public Map getBySku(@PathVariable Long skuId){
        Map<String, Object> bySkuId = itemService.getBySkuId(skuId);
        return bySkuId;
    }
}
